package cranix.common.action;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.interceptor.ParameterAware;
import org.apache.struts2.interceptor.ServletRequestAware;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.Preparable;

import cranix.common.util.Box;
import cranix.common.util.BoxUtil;

@SuppressWarnings("serial")
public class SuperStruts2Action extends ActionSupport implements ServletRequestAware, ParameterAware, Preparable {

	private HttpServletRequest request = null;
	private Map params = null;
	private Box<String,Object> input = null;
	private Box<String,Object> result = null;
	
	public Box<String,Object> getInput() {
		return input;
	}
	public Box<String,Object> getResult() {
		return result;
	}
	protected void setResult(Box<String,Object> result) {
		this.result = result;
	}
	
	public void setParameters(Map params) {
		this.params = params;
	}
	public void setServletRequest(HttpServletRequest request) {
		this.request = request;
	}
	public void prepare() throws Exception {
		this.input = BoxUtil.getBox(params,request,"testProgram");	
	}
}
